#include "types.h"
#include "stat.h"
#include "user.h"
void sleepXTimes(int x)
{
   int start = uptime();
   int i;
  for (i=0; i<x; i++)
  {    
    sleep(1);
  }
  int end = uptime();
  printf(1,"total time %d\n",end - start);
}

void swappingTest()
{
  int N =20;
  printf(1,"sleeping %d times with swapping\n",N);
  enableSwapping();
  sleepXTimes(N);
  
  printf(1,"sleeping %d times without swapping\n",N);
  disableSwapping();
  sleepXTimes(N);
}

int main(void)
{
 swappingTest();
 exit();
}